package server.business.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import server.business.mapper.AdverseMapper;
import server.business.pojo.AdverseReaction;
import server.business.service.AdverseReactionService;

import java.util.List;

@Service("indexService")
public class AdverseReactionServicelmpl extends ServiceImpl<AdverseMapper, AdverseReaction> implements AdverseReactionService {

    @Autowired
    private AdverseMapper adverseMapper;
    @Autowired
    private AdverseReactionService adverseService;

    public IPage<AdverseReaction> selectByPage(int currentPage, int pageSize){
        Page<AdverseReaction> page = new Page<>(currentPage,pageSize);
        IPage<AdverseReaction> sampleIpage = adverseMapper.selectPage(page,null);
        return sampleIpage;
    }

    public List<AdverseReaction> queryData(){
        List<AdverseReaction> list = adverseService.list();
        return list;
    }
}
